Optimal. Leaf size=245 \[ \frac {5 (7 i A+5 B) \tanh ^{-1}\left (\frac {\sqrt {c-i c \tan (e+f x)}}{\sqrt {2} \sqrt {c}}\right )}{128 \sqrt {2} a^3 \sqrt {c} f}-\frac {5 (7 i A+5 B)}{128 a^3 f \sqrt {c-i c \tan (e+f x)}}+\frac {i A-B}{6 a^3 f (1+i \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}}+\frac {7 i A+5 B}{48 a^3 f (1+i \tan (e+f x))^2 \sqrt {c-i c \tan (e+f x)}}+\frac {5 (7 i A+5 B)}{192 a^3 f (1+i \tan (e+f x)) \sqrt {c-i c \tan (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 245, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.140, Rules used = {3669, 79, 44,
53, 65, 214} \begin {gather*} \frac {-B+i A}{6 a^3 f (1+i \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}}-\frac {5 (5 B+7 i A)}{128 a^3 f \sqrt {c-i c \tan (e+f x)}}+\frac {5 (5 B+7 i A)}{192 a^3 f (1+i \tan (e+f x)) \sqrt {c-i c \tan (e+f x)}}+\frac {5 B+7 i A}{48 a^3 f (1+i \tan (e+f x))^2 \sqrt {c-i c \tan (e+f x)}}+\frac {5 (5 B+7 i A) \tanh ^{-1}\left (\frac {\sqrt {c-i c \tan (e+f x)}}{\sqrt {2} \sqrt {c}}\right )}{128 \sqrt {2} a^3 \sqrt {c} f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 44
Rule 53
Rule 65
Rule 79
Rule 214
Rule 3669
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^4 (c-i c x)^{3/2}} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {i A-B}{6 a^3 f (1+i \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}}+\frac {((7 A-5 i B) c) \text {Subst}\left (\int \frac {1}{(a+i a x)^3 (c-i c x)^{3/2}} \, dx,x,\tan (e+f x)\right )}{12 f}\\ &=\frac {i A-B}{6 a^3 f (1+i \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}}+\frac {7 i A+5 B}{48 a^3 f (1+i \tan (e+f x))^2 \sqrt {c-i c \tan (e+f x)}}+\frac {(5 (7 A-5 i B) c) \text {Subst}\left (\int \frac {1}{(a+i a x)^2 (c-i c x)^{3/2}} \, dx,x,\tan (e+f x)\right )}{96 a f}\\ &=\frac {i A-B}{6 a^3 f (1+i \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}}+\frac {7 i A+5 B}{48 a^3 f (1+i \tan (e+f x))^2 \sqrt {c-i c \tan (e+f x)}}+\frac {5 (7 i A+5 B)}{192 a^3 f (1+i \tan (e+f x)) \sqrt {c-i c \tan (e+f x)}}+\frac {(5 (7 A-5 i B) c) \text {Subst}\left (\int \frac {1}{(a+i a x) (c-i c x)^{3/2}} \, dx,x,\tan (e+f x)\right )}{128 a^2 f}\\ &=-\frac {5 (7 i A+5 B)}{128 a^3 f \sqrt {c-i c \tan (e+f x)}}+\frac {i A-B}{6 a^3 f (1+i \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}}+\frac {7 i A+5 B}{48 a^3 f (1+i \tan (e+f x))^2 \sqrt {c-i c \tan (e+f x)}}+\frac {5 (7 i A+5 B)}{192 a^3 f (1+i \tan (e+f x)) \sqrt {c-i c \tan (e+f x)}}+\frac {(5 (7 A-5 i B)) \text {Subst}\left (\int \frac {1}{(a+i a x) \sqrt {c-i c x}} \, dx,x,\tan (e+f x)\right )}{256 a^2 f}\\ &=-\frac {5 (7 i A+5 B)}{128 a^3 f \sqrt {c-i c \tan (e+f x)}}+\frac {i A-B}{6 a^3 f (1+i \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}}+\frac {7 i A+5 B}{48 a^3 f (1+i \tan (e+f x))^2 \sqrt {c-i c \tan (e+f x)}}+\frac {5 (7 i A+5 B)}{192 a^3 f (1+i \tan (e+f x)) \sqrt {c-i c \tan (e+f x)}}+\frac {(5 (7 i A+5 B)) \text {Subst}\left (\int \frac {1}{2 a-\frac {a x^2}{c}} \, dx,x,\sqrt {c-i c \tan (e+f x)}\right )}{128 a^2 c f}\\ &=\frac {5 (7 i A+5 B) \tanh ^{-1}\left (\frac {\sqrt {c-i c \tan (e+f x)}}{\sqrt {2} \sqrt {c}}\right )}{128 \sqrt {2} a^3 \sqrt {c} f}-\frac {5 (7 i A+5 B)}{128 a^3 f \sqrt {c-i c \tan (e+f x)}}+\frac {i A-B}{6 a^3 f (1+i \tan (e+f x))^3 \sqrt {c-i c \tan (e+f x)}}+\frac {7 i A+5 B}{48 a^3 f (1+i \tan (e+f x))^2 \sqrt {c-i c \tan (e+f x)}}+\frac {5 (7 i A+5 B)}{192 a^3 f (1+i \tan (e+f x)) \sqrt {c-i c \tan (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.47, size = 181, normalized size = 0.74 \begin {gather*} \frac {(\cos (2 (e+f x))-i \sin (2 (e+f x))) \left (15 (7 i A+5 B) e^{2 i (e+f x)} \sqrt {1+e^{2 i (e+f x)}} \tanh ^{-1}\left (\sqrt {1+e^{2 i (e+f x)}}\right )+2 \cos (e+f x) ((125 i A+7 B) \cos (e+f x)+(-40 i A-56 B) \cos (3 (e+f x))+(7 A-5 i B) (-7 \sin (e+f x)+8 \sin (3 (e+f x))))\right ) \sqrt {c-i c \tan (e+f x)}}{768 a^3 c f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.40, size = 178, normalized size = 0.73
method | result | size |
derivativedivides | \(\frac {2 i c^{3} \left (\frac {\frac {8 \left (-\frac {9 i B}{128}+\frac {19 A}{128}\right ) \left (c -i c \tan \left (f x +e \right )\right )^{\frac {5}{2}}+8 \left (\frac {7}{24} i B c -\frac {17}{24} A c \right ) \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}+8 \left (-\frac {7}{32} i B \,c^{2}+\frac {29}{32} A \,c^{2}\right ) \sqrt {c -i c \tan \left (f x +e \right )}}{\left (c +i c \tan \left (f x +e \right )\right )^{3}}+\frac {5 \left (-\frac {5 i B}{8}+\frac {7 A}{8}\right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {c -i c \tan \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {c}}\right )}{4 \sqrt {c}}}{16 c^{3}}-\frac {-i B +A}{16 c^{3} \sqrt {c -i c \tan \left (f x +e \right )}}\right )}{f \,a^{3}}\) | \(178\) |
default | \(\frac {2 i c^{3} \left (\frac {\frac {8 \left (-\frac {9 i B}{128}+\frac {19 A}{128}\right ) \left (c -i c \tan \left (f x +e \right )\right )^{\frac {5}{2}}+8 \left (\frac {7}{24} i B c -\frac {17}{24} A c \right ) \left (c -i c \tan \left (f x +e \right )\right )^{\frac {3}{2}}+8 \left (-\frac {7}{32} i B \,c^{2}+\frac {29}{32} A \,c^{2}\right ) \sqrt {c -i c \tan \left (f x +e \right )}}{\left (c +i c \tan \left (f x +e \right )\right )^{3}}+\frac {5 \left (-\frac {5 i B}{8}+\frac {7 A}{8}\right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {c -i c \tan \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {c}}\right )}{4 \sqrt {c}}}{16 c^{3}}-\frac {-i B +A}{16 c^{3} \sqrt {c -i c \tan \left (f x +e \right )}}\right )}{f \,a^{3}}\) | \(178\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.53, size = 250, normalized size = 1.02 \begin {gather*} -\frac {i \, {\left (\frac {4 \, {\left (15 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{3} {\left (7 \, A - 5 i \, B\right )} c - 80 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{2} {\left (7 \, A - 5 i \, B\right )} c^{2} + 132 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )} {\left (7 \, A - 5 i \, B\right )} c^{3} - 384 \, {\left (A - i \, B\right )} c^{4}\right )}}{{\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{\frac {7}{2}} a^{3} - 6 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{\frac {5}{2}} a^{3} c + 12 \, {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{\frac {3}{2}} a^{3} c^{2} - 8 \, \sqrt {-i \, c \tan \left (f x + e\right ) + c} a^{3} c^{3}} + \frac {15 \, \sqrt {2} {\left (7 \, A - 5 i \, B\right )} \sqrt {c} \log \left (-\frac {\sqrt {2} \sqrt {c} - \sqrt {-i \, c \tan \left (f x + e\right ) + c}}{\sqrt {2} \sqrt {c} + \sqrt {-i \, c \tan \left (f x + e\right ) + c}}\right )}{a^{3}}\right )}}{1536 \, c f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 422 vs. \(2 (198) = 396\).
time = 1.23, size = 422, normalized size = 1.72 \begin {gather*} \frac {{\left (15 \, \sqrt {\frac {1}{2}} a^{3} c f \sqrt {-\frac {49 \, A^{2} - 70 i \, A B - 25 \, B^{2}}{a^{6} c f^{2}}} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (\frac {5 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (a^{3} f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{3} f\right )} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {49 \, A^{2} - 70 i \, A B - 25 \, B^{2}}{a^{6} c f^{2}}} + 7 i \, A + 5 \, B\right )} e^{\left (-i \, f x - i \, e\right )}}{64 \, a^{3} f}\right ) - 15 \, \sqrt {\frac {1}{2}} a^{3} c f \sqrt {-\frac {49 \, A^{2} - 70 i \, A B - 25 \, B^{2}}{a^{6} c f^{2}}} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (-\frac {5 \, {\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (a^{3} f e^{\left (2 i \, f x + 2 i \, e\right )} + a^{3} f\right )} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {49 \, A^{2} - 70 i \, A B - 25 \, B^{2}}{a^{6} c f^{2}}} - 7 i \, A - 5 \, B\right )} e^{\left (-i \, f x - i \, e\right )}}{64 \, a^{3} f}\right ) - \sqrt {2} {\left (48 \, {\left (i \, A + B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 3 \, {\left (-13 i \, A + 9 \, B\right )} e^{\left (6 i \, f x + 6 i \, e\right )} - {\left (125 i \, A + 7 \, B\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (-23 i \, A + 11 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 8 i \, A + 8 \, B\right )} \sqrt {\frac {c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{768 \, a^{3} c f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {i \left (\int \frac {A}{\sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{3}{\left (e + f x \right )} - 3 i \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{2}{\left (e + f x \right )} - 3 \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan {\left (e + f x \right )} + i \sqrt {- i c \tan {\left (e + f x \right )} + c}}\, dx + \int \frac {B \tan {\left (e + f x \right )}}{\sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{3}{\left (e + f x \right )} - 3 i \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan ^{2}{\left (e + f x \right )} - 3 \sqrt {- i c \tan {\left (e + f x \right )} + c} \tan {\left (e + f x \right )} + i \sqrt {- i c \tan {\left (e + f x \right )} + c}}\, dx\right )}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.67, size = 394, normalized size = 1.61 \begin {gather*} \frac {B\,c^3-\frac {25\,B\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3}{128}+\frac {25\,B\,c\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^2}{24}-\frac {55\,B\,c^2\,\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}{32}}{a^3\,f\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{7/2}-6\,a^3\,c\,f\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{5/2}-8\,a^3\,c^3\,f\,\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}+12\,a^3\,c^2\,f\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}+\frac {\frac {A\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3\,35{}\mathrm {i}}{128\,a^3\,f}-\frac {A\,c^3\,1{}\mathrm {i}}{a^3\,f}-\frac {A\,c\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^2\,35{}\mathrm {i}}{24\,a^3\,f}+\frac {A\,c^2\,\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,77{}\mathrm {i}}{32\,a^3\,f}}{6\,c\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{5/2}-{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{7/2}+8\,c^3\,\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}-12\,c^2\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}-\frac {\sqrt {2}\,A\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-c}}\right )\,35{}\mathrm {i}}{256\,a^3\,\sqrt {-c}\,f}+\frac {25\,\sqrt {2}\,B\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {c}}\right )}{256\,a^3\,\sqrt {c}\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________